package com.sqlparser.storage;

import java.util.*;

/**
 * 内存表结构
 */
public class Table {
    private final String name;
    private final List<String> columns;
    private final List<Map<String, Object>> rows;
    
    public Table(String name, List<String> columns) {
        this.name = name;
        this.columns = columns;
        this.rows = new ArrayList<>();
    }
    
    public void addRow(Map<String, Object> row) {
        rows.add(row);
    }
    
    public List<Map<String, Object>> getRows() {
        return rows;
    }
    
    public List<String> getColumns() {
        return columns;
    }
    
    public String getName() {
        return name;
    }
} 